package org.jspar.tile;

public class DefaultTileDelegate implements ITileDelegate {

	public static final ITileDelegate INSTANCE = new DefaultTileDelegate();

	@Override
	public boolean isSolid(Tile tile) {
		return tile.content() != null;
	}
	
	@Override
	public boolean isContentEquivalent(Tile t1, Tile t2) {
		return t1.content() == t2.content();
	}
	
	@Override
	public void insertContents(Tile tile, ITileContent what) {
		tile.setContent(what);
	}

	@Override
	public void manageContentsVsplit(Tile p, Tile c) {
		//throw new UnsupportedOperationException("should be overiden");
	}

	@Override
	public void manageContentsHsplit(Tile p, Tile c) {
		//throw new UnsupportedOperationException("should be overiden");
	}

	@Override
	public void manageContentsHmerge(Tile newTile, Tile oldTile) {
		//throw new UnsupportedOperationException("should be overiden");		
	}
	
	@Override
	public void manageContentsVmerge(Tile newTile, Tile oldTile) {
		//throw new UnsupportedOperationException("should be overiden");		
	}
	
	@Override
	public void manageContentsDeadTile(Tile temp) {
		//throw new UnsupportedOperationException("should be overiden");		
	}

}
